﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommerceOne.Domains.Entities;
using CommerceOne.Domains.Repositories;

namespace CommerceOne.Domains.SqlRepositories
{
    public class SqlCartRepository : ICartRepository
    {
        private readonly EfDbContext _context = new EfDbContext();

        /// <summary>
        /// Adds the specified cart.
        /// </summary>
        /// <param name="cart">The cart.</param>
        /// <returns></returns>
        public int Add(Cart cart)
        {
            this._context.Carts.Add(cart);
            return this._context.SaveChanges();
        }
    }
}
